<template>
  <el-dialog :title="'历史记录'" :close-on-click-modal="false" append-to-body :visible.sync="visible" lock-scroll width="1200px" custom-class="table-check-box-records">
    <el-row :gutter="15" type="flex" style="flex-wrap:wrap">
      <custom-table v-loading="loading" :data="list" height="625px">
        <el-table-column label="校区" prop="campusId" align="left" v-if="custom.hasP('campusId')" width="200" show-overflow-tooltip></el-table-column>
        <el-table-column prop="goodsName" label="商品名称" align="left" width="200" show-overflow-tooltip></el-table-column>
        <el-table-column prop="typeName" label="商品规格" width="160" />
        <el-table-column prop="account" label="帐号" align="center" v-if="custom.hasP('account')" width="150">
          <template slot-scope="scope">
            <span v-if="scope.row.endDate <= +new Date()" style="color:red">{{ scope.row.account }}</span>
            <span v-else>{{ scope.row.account }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="openDate" label="开通日期" align="center" v-if="custom.hasP('openDate')" :formatter="custom.tableDateFormat" width="100" />
        <el-table-column prop="startDate" label="开始日期" align="center" v-if="custom.hasP('startDate')" :formatter="custom.tableDateFormat" width="100" />
        <el-table-column prop="endDate" label="截止日期" align="center" v-if="custom.hasP('endDate')" :formatter="custom.tableDateFormat" width="100" />
        <el-table-column prop="matheVersion" label="数学版本" align="center" v-if="custom.hasP('matheVersion')" width="80">
          <template slot-scope="scope">
            {{ scope.row.matheVersion | dynamicText(matheVersionOptions) }}
          </template>
        </el-table-column>
        <el-table-column prop="price" label="价格" align="right" v-if="custom.hasP('price')" width="60" />
        <el-table-column prop="status" label="订单状态" align="center" v-if="custom.hasP('status')" width="70">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.status == 0" key="正常" type="success" effect="dark">
              正常
            </el-tag>
            <el-tag v-else-if="scope.row.status == 2" key="退款" type="danger" effect="dark">
              退款
            </el-tag>
            <el-tag v-else-if="scope.row.status == 4" key="作废" type="info" effect="dark">
              作废
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="source" label="来源" align="center" v-if="custom.hasP('source')" width="60">
          <template slot-scope="scope">
            {{ scope.row.source | dynamicText(sourceOptions) }}
          </template>
        </el-table-column>
        <el-table-column prop="payNo" label="支付单号" align="center" v-if="custom.hasP('payNo')" width="300"></el-table-column>
        <el-table-column prop="description" label="备注" align="left" v-if="custom.hasP('description')" width="300" show-overflow-tooltip />
        <el-table-column prop="createTime" label="创建时间" align="center" v-if="custom.hasP('createTime')" :formatter="custom.tableDateTimeFormat" width="120" />
        <el-table-column prop="createUserName" label="创建用户" align="left" v-if="custom.hasP('createUserName')" show-overflow-tooltip />
        <el-table-column prop="updateTime" label="修改时间" align="center" v-if="custom.hasP('updateTime')" :formatter="custom.tableDateTimeFormat" width="120" />
        <el-table-column prop="updateUserName" label="修改用户" align="left" v-if="custom.hasP('updateUserName')" />
      </custom-table>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from './index.js'
</script>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
@import url(index.scss);
</style>
